Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing /
Chapter 2 - Core Printing Features / Using Core Printing Features


Printing Macintosh Printing Manager Documents

Documents printed with applications that use the Macintosh Printing Manager can be printed on a system with QuickDraw GX installed without the application being aware that QuickDraw GX is installed. Printing in this way, however, does not allow the application to take advantage of QuickDraw GX printing features, such as additional options provided in QuickDraw GX print dialog boxes, formatting, customization, and so on.

You can modify an existing application to allow it to print a document designed for printing with the Macintosh Printing Manager by determining whether QuickDraw GX is installed and, if it is, performing these steps:

  1. Convert the print record associated with a Macintosh Printing Manager document into a job object.
  2. Install the QuickDraw GX Translator to convert the results of QuickDraw functions into special QuickDraw GX shape objects that are used to spool QuickDraw output.
  3. Execute your print loop. See the section "Printing Documents Using QuickDraw GX" beginning on page 2-20 for an example.
  4. Remove the QuickDraw GX Translator.

To convert the print record associated with a Macintosh Printing Manager document into a job object, use the GXConvertPrintRecord function. Listing 2-18 shows how to use the GXConvertPrintRecord function.

Listing 2-18 Converting a print record into a job object

OSErr MyPrintRecordToJob(MyDocumentPtr myDocument, THPrint hPrint)
{

/* 
   Convert the print record and store its settings in
   the specified job object. Dispose of its handle.
*/
   GXConvertPrintRecord(myDocument->documentJob, hPrint);
   DisposHandle((Handle) hPrint);

   return GXGetJobError(myDocument->documentJob);
}
In addition to converting the print record, you must also translate QuickDraw data using the QuickDraw GX Translator. You call the GXInstallQDTranslator function to install the translator, and you call the GXRemoveQDTranslator function when you are finished with the translation. The QuickDraw GX Translator and these functions are described in the QuickDraw GX environment chapter of Inside Macintosh: Environment and Utilities.

After you call GXInstallQDTranslator, you proceed to print using the normal print loop; for example, by calling GXStartPage to start a new page and GXFinishPage to finish it. The results of any QuickDraw function is translated and the output is spooled. When you are finished printing, call GXRemoveQDTranslator to end translation.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help